Intro
Chrome extension
This Nordcraft package enables dynamic interaction with any webpage’s DOM. It can read, add, modify, and delete DOM elements, as well as inject Nordcraft components directly into the page.
Demo
A few examples are provided, but many more options are available, see the arguments below for the many available options.
Current tabInfo
The current URL is:
Remove element
SelectorSet element
SelectorText-
Observe h1
H1 Value is currently:
Inject Nordcraft Component
Selector
Components
chrome_extension
Unstyled Nordcraft component containing the core logic for the Chrome extension. Simply add the component to your page to access all functionalities.
Events
TabinfoChanged Event tabInfoChanged provides information about the currently viewed website and triggers when the sidebar is loaded for the first time. chrome_observer
Use this component to observe an HTML element for changes in text, value, or other properties. Add it to your page with the correct attribute to instantly know what’s happening.
Events
valueChanged Provides information about the current selector and triggers when the observer first loads or when the current value changes. Context
Reload Workflow that reload the observer, for example on new pageload. Attributes
selector Specify the DOM selector of the HTML element to observe. attribute Choose the attribute to observe; defaults to innerText. event-type Choose the event type to observe; defaults to DOMSubtreeModified.
Actions
InjectComponent
Allows injecting Nordcraft components directly into the DOM.
Arguments
name Use the component name exactly as defined in the export-as-web-component functionality (toddle-componentName) src Use the script src value exactly as defined in the export-as-web-component functionality. selector Specify the DOM selector that defines the injection point for the component. placement Define the placement method: replace, append, or prepend, to control how the component is injected into the target element. manipulateDom
Allows modifying the DOM.
Arguments
selector Specify the DOM selector that defines the injection point for the component. action Specify the action to perform: setText, setHTML, setStyle, addClass, removeClass, toggleClass, appendHTML, prependHTML, click, setInputValue. newValue Specify the new value to be injected into the DOM.